<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.6.8/css/layui.min.css"   />
        <link rel="stylesheet" href="../../res/css/mz.css" />
        <script src="https://cdn.staticfile.org/layui/2.6.8/layui.min.js" ></script>
        <script src="../../res/js/mz.view.js"></script>
        <script src="../../res/js/mz.common.js"></script>
    </head>
    <body>

        <div style=" margin: 10px auto;">
            <div id="item_view"></div>
        </div>


        <script>

            var field_setting = [
                {title: '编号', name: 'id', type: 'hidden'},
                {title: '标题', name: 'title', type: 'text'},
                {title: 'sql', name: 'sql', type: 'text'},
                {title: '参数名', name: 'arg_names', type: 'text'},
                {title: 'sql类型', name: 'sql_type', type: 'text'},
                {title: '请求类型', name: 'http_methods', type: 'text'},
                {title: '请求地址', name: 'mapping_uri', type: 'text'},
                {title: '描述', name: 'description', type: 'textarea'}
            ];
            //加载模块
            layui.use(['jquery'], function(){
                layui.$.get(base_url + '/sql_one/' + getQueryString('id'), function(res){
                    new MZView({
                        dom: document.getElementById('item_view'),
                        type: 'item',
                        fieldSetting: field_setting,
                        data: res.content || {}
                    });
                })
            });


        </script>

    </body>
</html>
